﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using FlightSystemControlLayer;
using Classes;

namespace FlightSystemWCF
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "FlightService" in both code and config file together.
    public class FlightService : IFlightService
    {
        private static IFlightService flightServiceObj = new FlightService();
        private static SearcherCtr searcherControl = new SearcherCtr();
        private static BookingCtr bookingCotrol = new BookingCtr();

       
        public IList<City> GetCityList()
        {
            IList<City> cities = searcherControl.getCityList();
            return cities;
        }
        public ListOfConnections getListOfConnections(City from, City to, int noOfSeats, DateTime departure)
        {
            
            return searcherControl.MakeASearch(from, to, noOfSeats, departure);
        }
        public void Book(Connection conn, int seatsWanted, string fname, string lname, string address, string country, string phone, string email, string passport)
    {
        bookingCotrol.Book(conn, seatsWanted, fname, lname, address, country, phone, email, passport);
    }
    }
}
